package cn.com.huzo.model.entities.oa;

import com.fasterxml.jackson.annotation.JsonFormat;
import huzofw.model.entities.BaseEntity;
import huzofw.model.entities.IAggregateRoot;
import java.io.Serializable;
import java.sql.Timestamp;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 我的日程实体类
 *
 * @author 吴旭
 */
public class MyCalendarEntity extends BaseEntity implements Serializable, IAggregateRoot {

    private static final long serialVersionUID = 6903415809446219554L;
    private String CalendarId;       // 主键
    private Long UserId;             // 所述用户
    private String Title;            // 日程、事件标题
    private String Contents;         // 日程、事件内容
    private Timestamp StartTime;     // 开始时间
    private Timestamp EndTime;       // 结束時間
    private Short AllDay;            // 是否是全天事件
    private String Url;              // 事件被点击将打开对应url
    private String ClassName;        // 指定事件的样式
    private Short Editable;          // 事件是否可编辑，可编辑是指可以移动, 改变大小等
    private String BackgroundColor;	 // 背景颜色
    private String BorderColor;      // 边框颜色
    private String TextColor;        // 文本颜色

    public String getCalendarId() {
        return CalendarId;
    }

    public void setCalendarId(String CalendarId) {
        this.CalendarId = CalendarId;
    }

    public Long getUserId() {
        return UserId;
    }

    public void setUserId(Long UserId) {
        this.UserId = UserId;
    }

    public String getTitle() {
        return Title;
    }

    public void setTitle(String Title) {
        this.Title = Title;
    }

    public String getContents() {
        return Contents;
    }

    public void setContents(String Contents) {
        this.Contents = Contents;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    public Timestamp getStartTime() {
        return StartTime;
    }

    public void setStartTime(Timestamp StartTime) {
        this.StartTime = StartTime;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    public Timestamp getEndTime() {
        return EndTime;
    }

    public void setEndTime(Timestamp EndTime) {
        this.EndTime = EndTime;
    }

    public Short getAllDay() {
        return AllDay;
    }

    public void setAllDay(Short AllDay) {
        this.AllDay = AllDay;
    }

    public String getUrl() {
        return Url;
    }

    public void setUrl(String Url) {
        this.Url = Url;
    }

    public String getClassName() {
        return ClassName;
    }

    public void setClassName(String ClassName) {
        this.ClassName = ClassName;
    }

    public Short getEditable() {
        return Editable;
    }

    public void setEditable(Short Editable) {
        this.Editable = Editable;
    }

    public String getBackgroundColor() {
        return BackgroundColor;
    }

    public void setBackgroundColor(String BackgroundColor) {
        this.BackgroundColor = BackgroundColor;
    }

    public String getBorderColor() {
        return BorderColor;
    }

    public void setBorderColor(String BorderColor) {
        this.BorderColor = BorderColor;
    }

    public String getTextColor() {
        return TextColor;
    }

    public void setTextColor(String TextColor) {
        this.TextColor = TextColor;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof MyCalendarEntity)) {
            return false;
        }

        final MyCalendarEntity that = (MyCalendarEntity) o;

        return new EqualsBuilder()
                .append(this.getCalendarId(), that.getCalendarId())
                .isEquals();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        int result = 17;
        result = 31 * result + getCalendarId().hashCode();

        return result;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
